package edu.gyc.hiseckill.service;

import com.baomidou.mybatisplus.extension.service.IService;
import edu.gyc.hiseckill.error.BusinessException;
import edu.gyc.hiseckill.model.Item;

import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author ls
 * @since 2020-01-23
 */
public interface ItemService extends IService<Item> {

    public Item createItem(Item item) throws BusinessException;
    public Item getItem(Integer id) throws BusinessException;

    public List<Item> listItem();

     //减库存
    void decreaseStock(Integer itemId,Integer amount)throws BusinessException;

    //商品销量增加
    void increaseSales(Integer itemId,Integer amount)throws BusinessException;
}
